Results 1 to 8 of 8

Thread: Player Skin Checker

  1. #1
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default Player Skin Checker

    Hi , i found my skin checker mod and thought i would update/finish it and upload here for anyone who needs one

    What it does it scan through a list of 'allowed' skins ( atm it includes just all stock ones ) and if a players skin is not on the list, changes their model to a random allowed one.

    The force of the model is only current until they respawn , or change to a allowed skin. The reason being is i didnt want to change the players settings on them, noone likes that. So instead i made it so just while their in your server, there model will be changed.

    Settings, are changed at the top of the script,
    [Required] Scantime , time between scans, default is 10 seconds, dont go lower then 5.
    [Optional] Turn forcemodels OFF on each player
    [Optional] Send a message to the player when they had their skin changed

    To ADD/REMOVE skins to the list of allowed ones, just add them to each array.

    Save as whatever you want and exec from dmprecache.scr
    Code:
    /// Purple Elephants stock skin checker
    /// Date : 9/12/2013  [AUS]  so 12/9/2013 for those other people
    
    main:
    
    level waittill spawn
    
    if(level.skinrun)
    end
    
    level.skinrun = 1
    
    ///////////// Settings are here ///////////////////
    
    ///[Required] Time between scans ; in seconds , default is 10 , DONT GO LOWER THEN 5!!!
    level.scantime = int(10)
    
    //[Optional] Whether to warn players every time if model is not allowed << can get annoying if it messages every time they respawn.
    level.skin_warning = 0
    level.skin_message = "Your skin has been changed by the server to a stock one." 
    
    ///[Optional] Turn forcemodels off for the player
    level.forcemodeloff = 1
    
    ///////////// ^^^^^^^^^^^^^ ///////////////////
    waitthread get_skins
    thread scan_players    
    
    end
    
    get_skins:
    ///////---------------------Change allowed skins here----------------- ////////////////////////////
    
    //// ---Allowed ALLIES skins --- ////
    level.allowed_allies = makeArray
    /// Stock skins ////
    "models/player/allied_airborne.tik"
    "models/player/allied_manon.tik"
    "models/player/allied_pilot.tik"
    "models/player/allied_sas.tik"
    "models/player/american_army.tik"
    "models/player/american_ranger.tik"
    //// Place new skins below
    
    //// Place new skins above here
    endArray
    
    ///// --- Allowed AXIS Skins---- ///
    level.allowed_axis = makeArray
    /// Stock skins ////
    "models/player/german_afrika_officer.tik"
    "models/player/german_afrika_private.tik"
    "models/player/german_elite_officer.tik"
    "models/player/german_elite_sentry.tik"
    "models/player/german_kradshutzen.tik"
    "models/player/german_panzer_grenadier.tik"
    "models/player/german_panzer_obershutze.tik"
    "models/player/german_panzer_shutze.tik"
    "models/player/german_panzer_tankcommander.tik"
    "models/player/german_scientist.tik"
    "models/player/german_waffenss_officer.tik"
    "models/player/german_waffenss_shutze.tik"
    "models/player/german_wehrmacht_officer.tik"
    "models/player/german_wehrmacht_soldier.tik"
    "models/player/german_winter_1.tik"
    "models/player/german_winter_2.tik"
    "models/player/german_worker.tik"
    "models/player/german_waffen_officer.tik"
    "models/player/german_waffen_shutze.tik"
    //// Place new skins below
    
    //// Place new skins above here
    endArray    
    
    end
    //////////////////////////////////////////////
    scan_players:
    
    while(1)
    {
    
        waitthread get_skins
        
        for(local.i = 1; local.i <= $player.size; local.i++)
        {
            local.player= $player[local.i]
                    
            waitframe
            if(local.player != NULL && local.player.dmteam != "spectator" && isAlive(local.player))
            {     
                wait 2    
                
                //Forcemodel
                if(level.forcemodeloff == 1)
                local.player stufftext "cg_forcemodel 0"                        
    
            //////////////////////////////////////////////////////////////    
                //Checks player model against list of stock and/or allowed skins///         
                     if(local.player.dmteam == "allies")
                     {
                         local.player.allowed_skin = 0
                         for(local.i=1;local.i<=level.allowed_allies.size;local.i++)
                        {
                            local.allowed_skin = ""
                             local.allowed_skin = level.allowed_allies[local.i][1] 
                                    
                             /// Check to see if its on the list, if it is , sets allowed to 1
                             if(local.player.model == local.allowed_skin)
                             local.player.allowed_skin = 1
                                                    
                             waitframe
                        }
                        
                        /// if not allowed ie 0 
                        if(local.player.allowed_skin != 1)
                        thread change_skin local.player
                        
                     }
                     else
                     {
                         local.player.allowed_skin = 0
                         for(local.i=1;local.i<=level.allowed_axis.size;local.i++)
                        {
                            local.allowed_skin = ""
                             local.allowed_skin = level.allowed_axis[local.i][1] 
                        
                             /// Check to see if its on the list, if it is , sets allowed to 1
                             if(local.player.model == local.allowed_skin)
                             local.player.allowed_skin = 1
                             
                             waitframe
                        }
                        /// if not allowed ie 0 
                        if(local.player.allowed_skin != 1)
                        thread change_skin local.player
                        
                     }
             //////////////////////////////////////            
            } 
        }     
    wait level.scantime
    } 
    
    end
    
    change_skin local.player:
    
    //Warn Player of their Skin
    if(level.skin_warning == 1)
    local.player iprint level.skin_message
    
    
    /// now gives them a random model from the allowed list
    if(local.player.dmteam == "allies")
    {
    local.ran = randomint(level.allowed_allies.size)
    local.new_model = level.allowed_allies[local.ran + 1][1] 
    }
    else
    {
    local.ran = randomint(level.allowed_axis.size)
    local.new_model = level.allowed_axis[local.ran + 1][1]
    }
    
    waitframe
    
    local.player.model = local.new_model 
    local.player resetstate
                        
    end

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  2. #2
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    3,071

    Default

    Nice job man!! Thanks for sharing.

  3. #3

    Default

    Very nice !
    Camp another day.
    Barbarossa

  4. #4

    Default

    Do I need reborn installed to use this? Fragnet won't install the reborn patch and I learned the hard way server will crash without the server.exec installed...lol.

  5. #5
    Client Beta Testers Appelpitje's Avatar
    Join Date
    Jan 2012
    Location
    Belgium
    Posts
    545

    Default

    Wait fragnet wont install the patch?
    We had a SH server at them and they changed files for us to use Davens patches

  6. #6

    Default

    I've ask 2 times now and the support ticket just sat on hold for a week so I just closed it...lol fought with them over 3 hrs last night when I lost Rcon to server, they just kept telling me "it works at our end". the only mods they have to install is mefy's freeze tag stuff.I sent them thin reborn pk3 and the pdf along with this web site. I'll just wait till next year and go with a different company.

  7. #7
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    This should work without reborn,I don't think I used any reborn commands, but i half the time i dont notice when i use them.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  8. #8

    Default

    yes it works great with out reborn, I even managed to add my custom skins to it the right way... of course I had to do it 3 times before my old brain figured it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •